function [norm,len] = fouri(y)


%[y,Fs,bits]=wavread(file);

Fs=44100;

T = 1/Fs;                     % Sample time
L = length(y);                     % Length of signal
t = (0:L-1)*T;                % Time vector
% Sum of a 50 Hz sinusoid and a 120 Hz sinusoid
x = sin(2*pi*500*t) + sin(2*pi*1200*t); 
%y = x + 2*randn(size(t));     % Sinusoids plus noise

%subplot(2,1,1);
%plot(y);
%title('Signal');
%xlabel('time (milliseconds)');

%NFFT = 2^nextpow2(L); % Next power of 2 from length of y
NFFT = 2^15;
Y = fft(y,NFFT)/L;
f = Fs/2*linspace(0,1,NFFT/2);



% Plot single-sided amplitude spectrum.
%subplot(2,1,2);


q = 2*abs(Y(1:NFFT/2));
maxi = max(q);
norm = q/maxi;

len = length(norm);


plot(f,norm) ;

axis([0,6000,0,1]);
%title('Single-Sided Amplitude Spectrum of y(t)');
%xlabel('Frequency (Hz)');
%ylabel('|Y(f)|');